package com.ecom.common.controller;

import com.ecom.common.model.User;
import com.ecom.common.service.OrderService;
import com.ecom.common.service.ProductService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by jimmy on 7/31/14.
 */
@Controller
@RequestMapping("/order")
public class OrderController {

    private static final Logger logger = Logger.getLogger(ProductController.class);

    @Autowired
    OrderService orderService;


    @RequestMapping(method = RequestMethod.GET)
    public String initOrder(ModelMap model) {

        logger.debug(orderService.getShipMethods().get(0).getMethodName());

        return "hello";
    }

    @RequestMapping(method = RequestMethod.POST)
    public String submitOrder(@ModelAttribute("") User user, BindingResult result) {

        return "hello";
    }
}
